<?php
class announcements extends SClass {

    public function process() {
    	$announcements = ServiceUtils::GetFactory()->getAnnouncementService()->getAnnouncementAll();
    	$announcementsArray = array();
    	
    	while ($x = $announcements->getNext()) {
    		$announcementsArray[] = array(
    			'id' => $x->getId(),
    			'title' => $x->getTitle(),
    			'date' => $x->getPostdate(),
    			'url' => Engine_LinkMaker::GetURLByContentID(
    				'controlpanel-announcements-view',
    				$x->getId()
    			),
    			'pickUp' => Engine_LinkMaker::GetURLByContentID("controlpanel-announcements-pickUp",$x->getId()),
    			'delete' => Engine_LinkMaker::GetURLByContentID(
    				'controlpanel-announcements-delete',
    				$x->getId()
    			),
    			'edit' => Engine_LinkMaker::GetURLByContentID(
    				'controlpanel-announcements-edit',
    				$x->getId()
    			),
    		);
    	}
    	$this->assign('announcementsArray', $announcementsArray);
    }

}